<template>
  <div class="chat">
   <chat-nav></chat-nav>
   <chat-friends />
  </div>
</template>

<script>
import ChatNav from './ChatNav'
import ChatFriends from './ChatFriends.vue'
export default {
  components: { ChatNav, ChatFriends },
  name: '',
  data () {
    return {
      Allusers:[],
      
    }
  },
  computed:{
    _id(){
      return this.$store.getters.user?this.$store.getters.user._id :''
    }
  },
  mounted(){
    // if(!this._id){
    //   return alert('登录后可看到用户')
    // }else{
    //   this.getAllusers()
    // }

  },
  methods:{
  //获取所有用户
  getAllusers(){
      this.$axios({
      url:'/chat/allusers'
    }).then(data=>{
      this.Allusers = data.data
      // console.log(this.Allusers)
    })
    }
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.chat{
  padding-bottom: 44px;
  overflow: hidden;
}
</style>
